package day1217;

import org.junit.Test;

import java.util.ArrayList;
import java.util.LinkedList;

public class ss {
     static ArrayList<Integer> list = new ArrayList<>();

     public static int size(){
         return list.size();
     }

     public static void push(int val){
        list.add(val);
     }

     public static void pop(){
         System.out.println(list.get(list.size()-1));
         list.remove(list.size()-1);
     }

     public static int top(){
         return  list.get(list.size()-1);
     }

    public static void main(String[] args) {
        push(1);
        push(2);
        push(3);
        pop();
        System.out.println(size());
        System.out.println(top());
    }

}
